package com.fengchunge.controller;

import com.fengchunge.common.ServerResponse;
import com.fengchunge.pojo.UserInfo;
import com.fengchunge.service.IEncounterUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: tianmingtai
 * @create: 2021/05/07 20:09
 * @description:
 */

@Controller
@RequestMapping("/user/")
public class EncounterUserController {

    @Autowired
    private IEncounterUserService iEncounterUserService;

    /**
     * 上传用户信息
     *
     * @param userInfo 用户信息
     * @return
     */
    @RequestMapping(value = "statistic_user.do", method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<String> statisticUser(UserInfo userInfo) {

        return iEncounterUserService.statisticUser(userInfo);
    }

    /**
     * 上传用户信息
     *
     * @param id 用户信息
     * @return
     */
    @RequestMapping(value = "get_user_info.do", method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<UserInfo> getUserInfo(String id) {

        return iEncounterUserService.getUserInfo(id);
    }

}
